<template>
	<view>
		<view>
			<view class="smart-container">1.容器</view>
			<view class="smart-panel-title" @click="goDetailPage('viewpage')"><text>view视图</text></view>
			<view class="smart-panel-title">
				<navigator url="/pages/Custom/cardViewPage/cardViewPage">
					<text>cardViewPage</text>
				</navigator>
			</view>
			<view class="smart-panel-title">
				<navigator url="/pages/Custom/NewsListPage/NewsListPage">
					<text>NewsListPage</text>
				</navigator>
			</view>
			<view class="smart-container">2.基础内容</view>
			<view class="smart-panel-title" @click="goDetailPage('textview')"><text>text文本编辑</text></view>
			<view class="smart-panel-title" @click="goDetailPage('icon')"><text>icon图标</text></view>
			<view class="smart-container">3.表单组件</view>
			<view class="smart-panel-title" @click="goDetailPage('button')"><text>button图标</text></view>
			<view class="smart-panel-title" @click="goDetailPage('checkbox')"><text>checkbox多选框</text></view>
			<view class="smart-panel-title"><text>label标签组件</text></view>
			<view class="smart-panel-title"><text>input输入框</text></view>
			<view class="smart-panel-title"><text>textarea多行文本输入框</text></view>
			<view class="smart-panel-title" @click="goDetailPage('form')"><text>form表单</text></view>
			<view class="smart-container">4.导航组件</view>
			<view class="smart-panel-title" @click="goDetailPage('navigator')"><text>navigator导航</text></view>
			<view class="smart-container">5.媒体组件</view>
			<view class="smart-panel-title" @click="goDetailPage('image')"><text>image组件</text></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		onShow() {
			console.log("组件页onShow");
			uni.getStorage({
				key: 'UserName',
				success(result) {
					console.log("获取字段成功:" + JSON.stringify(result));
					this.accont = result.data;
				},
				fail(errMsg) {
					// [object object] [object]
					console.log("获取字段失败:" + JSON.stringify(errMsg));
				}
			})
		},
		methods: {
			goDetailPage(e) {
				if (typeof e === 'string') {
					uni.navigateTo({
						url: '/pages/components/' + e + '/' + e
					});
				} else {
					uni.navigateTo({
						url: e.url
					});
				}
			}
		}
	}
</script>

<style>

</style>